/**
 * Created by Administrator on 2016/10/12.
 */
$(function(){
    var obtn=$("#returnTop");
    var start=document.body.scrollTop;//scrollTop不能带（）
    obtn.click(function(){
/********************************************************************/
        var start = document.body.scrollTop;
        var end =0;
        var change = end-start;//要加change

        var timer1;
        var t = 0;
        var maxT = 30;
        var t1 = 17;
        timer1 = setInterval(function(){
            t++;
            if(t>=maxT){
                clearInterval(timer1);
            }
            document.body.scrollTop = start+change/maxT*t;
        },t1);
    })
});